<template>
    <div class="page-kernel " v-loading="loading_is">


        <span class="basic_configuration">基础配置</span>
        <button class="kernel_button stop" @click="BreakList">断开亮度计
        </button>
        <button class="kernel_button success" @click="ConnectList">连接亮度计
        </button>
        <el-divider></el-divider>
        <!-- 光圈 -->
        <div class="kernel_body">
            <div class="kernel_rows">
                <div class="custom-heading">切换测试项
                    <el-select v-model="Kernel_Item_id" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Item" :key="value" :label="label" :value="value"
                            class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="CutItem">确 定</el-button>
                </div>

            </div>


            <div class="kernel_rows">
                <div class="custom-heading danger" v-if="Kernel_Item_id == 0">请先选择测试项

                </div>
                <div class="custom-heading" v-if="Kernel_Item_id == 1">设置white曝光时间
                    <el-select v-model="Kernel_Exposure_Time_id" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="CutExposureTime">确 定</el-button>
                </div>
                <div class="custom-heading" v-if="Kernel_Item_id == 3">设置锥光镜头曝光时间
                    <el-select v-model="Kernel_Exposure_TimeAuxiliary_id" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="CutExposureTimeAuxiliary">确 定</el-button>
                </div>
                <div class="custom-heading" v-if="Kernel_Item_id == 7">设置色度测试曝光时间
                    <el-select v-model="Kernel_Exposure_TimeAll_id_y" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-select v-model="Kernel_Exposure_TimeAll_id_x1" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-select v-model="Kernel_Exposure_TimeAll_id_x2" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-select v-model="Kernel_Exposure_TimeAll_id_z" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                            :value="value" class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="CutExposureTimeAll">确 定</el-button>
                </div>
            </div>


            <div class="kernel_rows">
                <div class="custom-heading">设置焦距:<div>
                        <table class="custom-heading" style="margin-bottom: 15px;">
                            <tr>
                                <td>
                                    <button class="custom-button" @click="adjustValue(-100)">-100</button>
                                </td>
                                <td>
                                    <button class="custom-button" @click="adjustValue(-10)">-10</button>
                                </td>
                                <td>
                                    <button class="custom-button" @click="adjustValue(-1)">-1</button>
                                </td>

                                <td>
                                    <input class="custom-heading" type="number" v-model="kernel.focus_distance" step="0.01"
                                        min="0">
                                </td>
                                <td>
                                    <button class="custom-button" @click="adjustValue(1)">+1</button>
                                </td>
                                <td>
                                    <button class="custom-button" @click="adjustValue(10)">+10</button>
                                </td>
                                <td>
                                    <button class="custom-button" @click="adjustValue(100)">+100</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>

            <div class="kernel_rows">
                <div class="custom-heading">保存路径:{{ save_file.url }}\{{
                    save_file.savefileone
                }}
                    <el-button type="primary" @click="SetSavePath">确 定</el-button>
                </div>
            </div>





            <div class="kernel_rows">
                <div>
                    <el-switch v-model="color_value" active-color="#13ce66" inactive-color="#ff4949" active-text="伪彩图"
                        inactive-text="灰度图">
                    </el-switch>
                </div>
                <div class="custom-heading1">保存图片
                    <el-select v-model="save_picture_id" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Item" :key="value" :label="label" :value="value"
                            class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="is_address = true">确 定</el-button>
                </div>
                <div class="custom-heading1">启动测量
                    <el-select v-model="ExecMeasure_id" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Item" :key="value" :label="label" :value="value"
                            class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                    <el-button type="primary" @click="GetExecMeasure">确 定</el-button>
                </div>
            </div>




            <div class="kernel_rows height_add">
                <div class="custom-heading">保存亮度文件
                    <el-input class="input_file" v-model="Save_file_name"></el-input>
                    <el-button type="primary" @click="SaveBrightnessData">确 定</el-button>
                </div>

            </div>





            <div class="kernel_rows height_add ">
                <div class="custom-heading">保存色度文件
                    <el-input class="input_file" v-model="Save_Color_name"></el-input>
                    <el-button type="primary" @click="SaveColorData">确 定</el-button>
                </div>
            </div>


            <div class="kernel_rows height_add ">
                <div class="custom-heading">新增配置:&nbsp;&nbsp;&nbsp;
                    <el-button class="custom-button primary" @click="Createkernel">
                        新增配置
                    </el-button>
                </div>
                <div class="custom-heading">获取自动曝光配置:&nbsp;&nbsp;&nbsp;
                    <el-button class="custom-button primary" @click="open_GetAutoExposureTime">
                        获取配置
                    </el-button>
                </div>
            </div>

        </div>

        <div class="kernel_foot">




        </div>








        <el-dialog v-loading="loading" element-loading-text="正在保存图片中" element-loading-spinner="el-icon-loading"
            element-loading-background="rgba(0, 0, 0, 0.8)" title="保存图片" :visible.sync="is_address" width="30%"
            :before-close="handleClose_is_address">
            <el-form>
                <el-form-item label="图片名:" :label-width="formLabelWidth">
                    <el-input v-model="address"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="is_address = false">取 消</el-button>
                <el-button type="primary" @click="SetSavePicture">确 定</el-button>
            </div>
        </el-dialog>
        <!--    新增配置-->
        <el-dialog title="添加kernel配置" :visible.sync="is_createkernel" width="30%"
            :before-close="handleClose_is_createkernel">
            <el-form>
                <div class="kernel_create">
                    <el-form-item label="配置名称:" :label-width="formLabelWidth">
                        <el-input v-model="kernel.name_file"></el-input>
                    </el-form-item>

                    <el-form-item label="选择测试项:" :label-width="formLabelWidth">
                        <el-select v-model="kernel.Kernel_Item_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Item" :key="value" :label="label" :value="value"
                                class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="设置white曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 1">
                        <el-select v-model="kernel.Kernel_Exposure_Time_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="设置椎光曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 3">
                        <el-select v-model="kernel.Kernel_Exposure_Time_Auxiliary_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="设置y曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 7">
                        <el-select v-model="kernel.Kernel_Exposure_Time_y_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="设置x1曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 7">
                        <el-select v-model="kernel.Kernel_Exposure_Time_x1_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="设置x2曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 7">
                        <el-select v-model="kernel.Kernel_Exposure_Time_x2_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="设置z曝光时间:" :label-width="formLabelWidth" v-if="kernel.Kernel_Item_id == 7">
                        <el-select v-model="kernel.Kernel_Exposure_Time_z_id" class="el-input__count-inner">
                            <el-option v-for="(label, value) in Kernel_Exposure_Time" :key="value" :label="label"
                                :value="value" class="inner">
                                {{ label }}
                            </el-option>
                        </el-select>
                    </el-form-item>


                </div>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="is_createkernel = false">取 消</el-button>
                <el-button type="primary" @click="createkernel_one">确 定</el-button>
            </div>
        </el-dialog>

        <el-dialog v-loading="loading_GetAutoExposureTime" element-loading-text="正在计算曝光时间"
            element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" title="获取自动曝光配置"
            :visible.sync="is_GetAutoExposureTime" width="30%" :before-close="handleClose_is_createkernel">
            <el-form>
                <el-form-item label="选择测试项:" :label-width="formLabelWidth">
                    <el-select v-model="GetAutoExposureTime_value.test_item" class="el-input__count-inner">
                        <el-option v-for="(label, value) in Kernel_Item" :key="value" :label="label" :value="value"
                            class="inner">
                            {{ label }}
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="信号强度:" :label-width="formLabelWidth">
                    <el-input class="" v-model="GetAutoExposureTime_value.signalStrength"></el-input>
                </el-form-item>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <el-button @click="is_GetAutoExposureTime = false">取 消</el-button>
                <el-button type="primary" @click="GetAutoExposureTime">确 定</el-button>
            </div>
        </el-dialog>

    </div>
</template>

<script>
export default {
    created() {
        this.GetItem()
        this.savefile()
        this.GetExposureTime()
    },
    data() {
        return {
            color_value: false,
            loading_is: false,
            loading: false,
            loading_GetAutoExposureTime: false,
            save_file: "",
            Kernel_Item: "",
            Kernel_Item_id: 0,
            Kernel_Exposure_Time: "",
            Kernel_Exposure_Time_id: -1,
            Kernel_Exposure_TimeAll_id_y: -1,
            Kernel_Exposure_TimeAll_id_x1: -1,
            Kernel_Exposure_TimeAll_id_x2: -1,
            Kernel_Exposure_TimeAll_id_z: -1,
            Kernel_Exposure_TimeAuxiliary_id: -1,
            ExecMeasure_id: 0,
            save_picture_id: 0,
            is_address: false,
            Save_file_name: '',
            Save_Color_name: '',
            address: '',
            is_createkernel: false,
            is_GetAutoExposureTime: false,
            GetAutoExposureTime_value: {
                test_item: 0,
                signalStrength: ''
            },
            kernel: {
                name_file: '',
                Kernel_Item_id: 0,
                Kernel_Exposure_Time_id: 0,
                Kernel_Exposure_Time_Auxiliary_id: 0,
                Kernel_Exposure_Time_y_id: 0,
                Kernel_Exposure_Time_x1_id: 0,
                Kernel_Exposure_Time_x2_id: 0,
                Kernel_Exposure_Time_z_id: 0,
                focus_distance:0,
            },
            formLabelWidth: "120",
        };
    },

    mounted() {
        this.$watch('kernel.focus_distance', (newValue, oldValue) => {
            this.$axios.post(this.$settings.BASE_URL_CMS + 'CMS-Kernel/KernelBrightness/SetCameraFocus/', {'val': parseFloat(newValue)}).then((res) => {
                if (res.data.code == 100) {
                    this.$notify({
                        title: res.data.msg,
                        type: 'success'
                    });
                } else {
                    this.$notify.error({title: res.data.msg});
                }
            })
        });
    },


    methods: {
        adjustValue(value) {
            this.kernel.focus_distance = parseFloat((parseFloat(this.kernel.focus_distance) + value).toFixed(2));
        },
        open_GetAutoExposureTime() {
            this.is_GetAutoExposureTime = true
        },
        GetAutoExposureTime() {
            this.loading_GetAutoExposureTime = true
            this.$axios.post(this.$settings.BASE_URL_CMS + 'CMS-Kernel/AutoGetSuitableExposureTime/',
                {
                    'index': this.GetAutoExposureTime_value.test_item,
                    'signalStrength': this.GetAutoExposureTime_value.signalStrength
                }).then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                        this.is_GetAutoExposureTime = false
                        if (this.GetAutoExposureTime_value.test_item == 1) {
                            console.log(res.data.data)

                            this.Kernel_Exposure_Time_id = Object.keys(this.Kernel_Exposure_Time)[res.data.data[0]['pExposureTimeIndex']]
                            console.log('Kernel_Exposure_Time_id', this.Kernel_Exposure_Time_id)
                        }
                        if (this.GetAutoExposureTime_value.test_item == 3) {
                            this.Kernel_Exposure_TimeAuxiliary_id = Object.keys(this.Kernel_Exposure_Time)[res.data.data[0]['pExposureTimeIndex']]
                        }
                        if (this.GetAutoExposureTime_value.test_item == 7) {
                            this.Kernel_Exposure_TimeAll_id_y = Object.keys(this.Kernel_Exposure_Time)[res.data.data[0]['pExposureTimeIndex']]
                            this.Kernel_Exposure_TimeAll_id_x1 = Object.keys(this.Kernel_Exposure_Time)[res.data.data[1]['pExposureTimeIndex']]
                            this.Kernel_Exposure_TimeAll_id_x2 = Object.keys(this.Kernel_Exposure_Time)[res.data.data[2]['pExposureTimeIndex']]
                            this.Kernel_Exposure_TimeAll_id_z = Object.keys(this.Kernel_Exposure_Time)[res.data.data[3]['pExposureTimeIndex']]
                        }
                        this.loading_GetAutoExposureTime = false
                    }
                })
        },
        Createkernel() {
            this.is_createkernel = true
        },
        handleClose_is_address(done) {
            this.$confirm('确认关闭？')
                .then(_ => {
                    done();
                })
                .catch(_ => {
                });
        },
        handleClose_is_createkernel(done) {
            this.$confirm('确认关闭？')
                .then(_ => {
                    done();
                })
                .catch(_ => {
                });
        },
        savefile() {
            this.$axios
                .get(this.$settings.BASE_URL_CMS + `CMS-Task/savefiles/`)
                .then((res) => {
                    if (res.data.code == 100) {
                        console.log(res.data.data);
                        this.save_file = res.data.data[0];
                    }
                });
        },
        // 获取测试项
        GetItem() {
            this.$axios
                .get(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelTestItem/`)
                .then((res) => {
                    if (res.data.code == 100) {
                        this.Kernel_Item = res.data.data;
                        this.Kernel_Item_id = Object.keys(this.Kernel_Item)[0];
                        this.save_picture_id = Object.keys(this.Kernel_Item)[0];
                        this.ExecMeasure_id = Object.keys(this.Kernel_Item)[0];
                        this.kernel.Kernel_Item_id = Object.keys(this.Kernel_Item)[0];
                        this.GetAutoExposureTime_value.test_item = Object.keys(this.Kernel_Item)[0];
                    }
                });
            // this.Kernel_Item_id = Object.keys(this.Kernel_Item)[0];
        },
        // 修改测试项
        CutItem() {
            console.log(this.Kernel_Item_id)
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/CutItem/`, { 'index': this.Kernel_Item_id })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        // 获取曝光时间
        GetExposureTime() {
            this.$axios
                .get(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelExposureTime/`)
                .then((res) => {
                    if (res.data.code == 100) {
                        this.Kernel_Exposure_Time = res.data.data;
                        console.log(this.Kernel_Exposure_Time)

                        this.Kernel_Exposure_Time_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.Kernel_Exposure_TimeAuxiliary_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.Kernel_Exposure_TimeAll_id_y = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.Kernel_Exposure_TimeAll_id_x1 = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.Kernel_Exposure_TimeAll_id_x2 = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.Kernel_Exposure_TimeAll_id_z = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_Auxiliary_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_y_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_x1_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_x2_id = Object.keys(this.Kernel_Exposure_Time)[56];
                        this.kernel.Kernel_Exposure_Time_z_id = Object.keys(this.Kernel_Exposure_Time)[56];
                    }
                });
            // this.Kernel_Item_id = Object.keys(this.Kernel_Item)[0];
        },
        // 修改white曝光时间
        CutExposureTime() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SetTimeY/`, { 'index': this.Kernel_Exposure_Time_id })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        // 修改锥光镜头曝光时间
        CutExposureTimeAuxiliary() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SetTimeAuxiliary/`, { 'index': this.TimeAuxiliary })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        // 修改色度测试曝光时间
        CutExposureTimeAll() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SetTimeAll/`,
                    {
                        'y': this.Kernel_Exposure_TimeAll_id_y,
                        'x1': this.Kernel_Exposure_TimeAll_id_x1,
                        'x2': this.Kernel_Exposure_TimeAll_id_x2,
                        'z': this.Kernel_Exposure_TimeAll_id_z
                    })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        // 保存图片
        SetSavePicture() {
            this.loading = true
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SetSavePicture/`,
                    {
                        'index': this.save_picture_id,
                        'picture_name': this.address,
                        'state': this.color_value

                    })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.loading = false
                        this.is_address = false
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                        this.loading = false
                    }
                });
        },
        SetSavePath() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SetSavePath/`)
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        GetExecMeasure() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/ExecMeasure/`, { 'index': this.ExecMeasure_id })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        SaveBrightnessData() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SaveBrightnessData/`, { 'Save_file_name': this.Save_file_name })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        SaveColorData() {
            this.$axios
                .post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/SaveColorData/`, { 'Save_Color_name': this.Save_Color_name })
                .then((res) => {
                    if (res.data.code == 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                });
        },
        // 连接亮度计
        ConnectList() {
            this.$axios.get(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/Connect/`).then((res) => {
                if (res.data.code === 100) {
                    this.$notify({
                        title: res.data.msg,
                        type: 'success'
                    });
                } else {
                    this.$notify.error({ title: res.data.msg });
                }
            })
        },
        BreakList() {
            this.$axios.get(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelBrightness/Device/`).then((res) => {
                if (res.data.code === 100) {
                    this.$notify({
                        title: res.data.msg,
                        type: 'success'
                    });
                } else {
                    this.$notify.error({ title: res.data.msg });
                }
            })
        },
        // 保存亮度计配置
        createkernel_one() {
            this.$axios.post(this.$settings.BASE_URL_CMS + `CMS-Kernel/KernelList/`,
                {
                    'kernel_name': this.kernel.name_file,
                    'TestItem': this.kernel.Kernel_Item_id,
                    'TimeOfExposure': this.kernel.Kernel_Exposure_Time_id,
                    'TimeOfExposureAuxiliary': this.kernel.Kernel_Exposure_Time_Auxiliary_id,
                    'TimeOfExposureY': this.kernel.Kernel_Exposure_Time_y_id,
                    'TimeOfExposureX1': this.kernel.Kernel_Exposure_Time_x1_id,
                    'TimeOfExposureX2': this.kernel.Kernel_Exposure_Time_x2_id,
                    'TimeOfExposureZ': this.kernel.Kernel_Exposure_Time_z_id,
                }).then((res) => {
                    if (res.data.code === 100) {
                        this.$notify({
                            title: res.data.msg,
                            type: 'success'
                        });
                        this.is_createkernel = false
                    } else {
                        this.$notify.error({ title: res.data.msg });
                    }
                })
        }

    }
    ,
};
</script>

<style lang="less">
.el-select-dropdown__list {
    background-color: #262626;
}

.el-select-dropdown .el-select-dropdown__item {
    background-color: #262626;
    /* 设置背景颜色为白色 */
}

.page-kernel {
    overflow: hidden; //高度超出显示滚动条

    // 检测屏幕宽度
    @media screen and (min-width: 1000px) and (max-width: 1500px) {

        // 屏幕宽度在1000 到 1500之间
        .el-button {
            height: @h*40vh;
            line-height: 1;
            // padding: @h*5vh @w*8vw;
            font-size: 1rem;
        }
    }

    .el-dialog {
        background-color: #262626 !important;
        color: #ccc;
        /*color: #ccc;*/
    }

    .el-dialog__title {
        color: #cccccc;

    }

    .el-input__inner {
        background-color: #262626;
        color: #ccc;
        border-radius: 0px;

    }



    .kernel_create {
        margin: 20vh*@h 40vw*@w;
    }

    .basic_configuration {
        font-size: 40vh*@h;
        float: left;
        margin: 20vh*@h 40vw*@w;
        color: #fff;
        z-index: 999;
        width: 900vw*@w;
        height: 50vh*@h;
        line-height: 70vh*@h;

    }

    .kernel_button {
        margin: 30vh*@h 0 0 5vw*@w;
        font-size: 20px;
        width: 200px;
        height: 50px;

        color: white;
    }

    .danger {
        color: red;
        font-size: 30vh*@h !important;
    }

    .primary {
        background-color: rgb(0, 162, 255);
        color: #fff;
    }

    .success {
        background-color: green;

    }

    .stop {
        background-color: red;
    }

    .el-divider {
        float: left;
        width: 1920vw*@w;
    }

    .height_add {
        margin-top: 30vh*@h !important;
        height: 50vh*@h !important;
    }

    .kernel_body {
        float: left;
        width: 1920vw*@w;
        height: 650vh*@h;

        .kernel_rows {
            margin: 10vh*@h 0 0 20vw*@w;
            float: left;
            width: 1880vw*@w;
            height: 100vh*@h;

            .custom-heading {
                font-size: 18vh*@h;
                float: left;
                width: 100%;
                margin: 10vh*@h 0;

            }

            .custom-heading1 {
                font-size: 18vh*@h;
                float: left;
                width: 25%;
                margin: 10vh*@h 0;
            }

            .el-select {
                margin-left: 20vw*@w;
            }

            .input_file {
                width: 20%;
            }

        }

    }

    .kernel_foot {
        float: left;
        width: 0vw*@w;
        height: 300vh*@h;
    }





}
</style>
